﻿using System;

namespace ReadNumbers
{
    class ReadNumbers
    {
        static void ReadNumber(int startNumber, int endNumber)
        {
            for (int i = 0; i < 10; i++)
            {
                Console.Write("Enter an integer between {0} and {1}: ", startNumber, endNumber);
                int number = int.Parse(Console.ReadLine());
                if (number < startNumber || number > endNumber)
                {
                    throw new ArgumentException("The number is out of range.");
                }
            }
        }

        static void Main()
        {
            try
            {
                ReadNumber(0, 100);
            }
            catch (FormatException e)
            {
                Console.WriteLine(e.Message);
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}
